package gtgold;

/**
 * Party rations enumerated type
 * 
 * @author jo
 *
 */
public enum Ration
{
	NONE(0), BAREBONES(1), MEAGER(2), FILLING(3);

	final public double food;

	Ration(double amount)
	{
		food = amount;
	}

	public static Ration foodAmountToRation(double amount, Ration max)
	{
		Ration best = NONE;
		for (Ration r : values())
		{
			if (r.food <= max.food && r.food <= amount)
			{
				best = r;
			}
		}
		return best;
	}

	/*
	 * NONE (0,0), BAREBONES (1,1), MEAGER (2,2), FILLING (3,3);
	 * 
	 * final public double index; final public double food;
	 * 
	 * Ration(double id, double amount) {index=id; food=amount;}
	 */
}
